<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE HTML>
<html lang="en-US">
	<head>
		<meta charset="UTF-8">
		<title>凯盛项目管理系统</title>
		<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
		<link rel = "Shortcut Icon" href="http://www.kaishengit.com/favicon.ico" />
		<script type="text/javascript" src="js/jquery.js"></script>
		<style type="text/css">
.input-xlarge {
	width: 460px;
}
</style>
	</head>
	<body>
		<div class="container">
			<div class="navbar">
				<div class="navbar-inner">
					<div class="container">
						<a href="main" class="brand">凯盛项目管理系统</a>
						<ul class="nav pull-right">
							<li class="active">
								<a>${sessionScope.user.name }</a>
							</li>
							<li>
								<a href="user">个人资料</a>
							</li>
							<li class="divider-vertical"></li>
							<li>
								<a href="loginout">安全退出</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="span3">
					<div class="wall">
						<ul class="nav nav-list">
							<li class="nav-header">
								${project.name }
							</li>
							<li class="divider"></li>
							<li>
								<a href="project?id=${project.id }">
									<i class="icon-home"></i>最新动态
								</a>
							</li>
							<li>
								<a href="goal"> 
									<i class="icon-flag"></i>目标
								</a>
							</li>
							<li>
								<a href="document"> 
									<i class="icon-folder-open"></i>资料库
								</a>
							</li>
							<li>
								<a href="folder"> 
									<i class="icon-file"></i>文件共享 
								</a>
							</li>
							<li class="active">
								<a href="contact"> 
									<i class="icon-white icon-user"></i>联系人 
								</a>
							</li>
							<li>
								<a href="idea">
									<i class="icon-fire"></i>想法 
								</a>
							</li>
							<li>
								<a href="project?m=edit"> 
									<i class="icon-cog"></i>项目设置 
								</a>
							</li>
						</ul>
					</div>
				</div>
				<div class="span9">
                <ul class="breadcrumb">
                    <li class="active">
                        <i class="icon-user"></i>联系人
                    </li>
                </ul>
                <div class="wall">
                    <div class="row">
                        <div class="span3">
                            <a href="contact?m=new" class="btn span2">
                                <i class="icon-plus"></i>添加联系人
                            </a>
                            <div class="clear"></div>
                            <c:forEach var="contact" items="${contacts }">
                            	<ul class="unstyled" style="margin-top:15px;">
	                                <li>
	                                    <i class="icon-list-alt"></i><a href="contact?id=${contact.id }">${contact.name }</a>
	                                </li>
	                            </ul>
                            </c:forEach>
                        </div>
                        <div class="span5" style="min-height:400px;border-left:1px solid #ccc;padding-left:15px">
                            <c:if test="${fn:length(contact.name) > 0 }">
	                            <img src="https://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=${qr }" class="pull-right" height="180px" width="180px" />
	                            <address>
	                                <h3> ${contact.name } </h3>
	                                <c:if test="${fn:length(contact.company) != 0 }">
	                                	<p>${contact.company }</p>
	                                </c:if>
	                                <c:if test="${fn:length(contact.mobile) != 0 }">
	                                	<small>手机</small> ${contact.mobile }<br>
	                                </c:if>
	                                <c:if test="${fn:length(contact.phone) != 0 }">
	                                	<small>固话</small> ${contact.phone }<br><br>
	                                </c:if>
	                                <c:if test="${fn:length(contact.email) != 0 }">
	                                	<small>邮箱</small> <a href="mailto:${contact.email }"  target="_blank">${contact.email }</a><br>
	                                </c:if>
	                                <c:if test="${fn:length(contact.address) != 0 }">
	                                	<small>地址</small> ${contact.address }<br><br>
	                                </c:if>
	                                <c:if test="${fn:length(contact.homePage) != 0 }">
	                                	<small>主页</small> <a href="${contact.homePage }"  target="_blank">${contact.homePage }</a><br>
	                                </c:if>
	                                <c:if test="${fn:length(contact.weibo) != 0 }">
	                                	<small>微博</small> <a href="${contact.weibo }"  target="_blank">@${contact.atWeibo }</a><br>
	                                </c:if>
	                            </address>
	                            <div class="line">记录</div>
	                            <c:forEach var="contactUser" items="${contactUsers }" end="2">
				                    <blockquote>
				                        ${contactUser.message }
				                        <small>
				                        	${contactUser.userName } 发布于 ${contactUser.strTime }
				                        </small>
				                    </blockquote>
			                    </c:forEach>
	                            <a href="contact?m=note&id=${contact.id }">查看所有记录</a>
	                            <br><br><br>
	                            <a class="btn btn-primary" href="contact?m=edit&id=${contact.id }"><i class="icon-pencil icon-white"></i>编辑</a>
	                            <a class="btn btn-danger" href="contact?m=del&id=${contact.id }" id ="del"><i class="icon-trash icon-white"></i>删除</a>
                            </c:if>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
    	$("#del").click(function() {
    			var msg = "你真的要删除吗？";
    			if (!confirm(msg)){
					return false;	
				}
    		});
    </script>
</body>
</html>